﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace aQuery
{
    public class ActionReader<T> : IExecutable where T : class
    {

        #region public members
        public T Target { get; set; }

        public void ExecuteYourself()
        {
            foreach (ActionAtTarget<T> act in Actions)
            {
                act.Invoke(this.Target);
            }
        }
        #endregion

        #region internal members
        internal List<ActionAtTarget<T>> Actions { get; set; }

        internal ActionReader(T target)
        {
            this.Target = target;

            this.Actions = new List<ActionAtTarget<T>>();
        }
        #endregion

    }
}
